<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://unpkg.com/vue@next"></script>
  <style>
    .cal-header{
      width:796px;
      border: 1px solid #ccc;
      border-bottom: none;
      height: 30px;
      text-align: right;
      font-size: 18px;
    }
    .cal-main{
      display: flex;
      flex-direction: row;
      width:800px;
      flex-wrap: wrap;
      border:1px solid #ccc;
    }
    .cal-button-item{
      width:199px;
      border-right:1px solid #ccc;
      text-align: center;
      border-bottom: 1px solid #ccc;
      height: 30px;
      line-height: 30px;
      cursor: pointer;
    }
    .cal-button-item:nth-of-type(4n){
      border-right: none;
    }
    /** 0 **/
    .cal-button-item:nth-of-type(17){
      border-bottom: none;
    }
    /** . **/
    .cal-button-item:nth-of-type(18){
      border-bottom: none;
      width:399px;
    }
    /** = **/
    .cal-button-item:nth-of-type(19){
      border-bottom: none;
      border-right: none;
    }
  </style>
</head>
<body>
<div id="app"></div>
<script>
  const {createApp, reactive, ref} =  Vue;
  const buttonList = [
    {
      title:"AC",
      value:"AC"
    },
    {
      title:"C",
      value:"C"
    },
    {
      title:"B",
      value:"B"
    },
    {
      title:"/",
      value:"/"
    },
    {
      title:"7",
      value:"7"
    },
    {
      title:"8",
      value:"8"
    },
    {
      title:"9",
      value:"9"
    },
    {
      title:"*",
      value:"*"
    },
    {
      title:"4",
      value:"4"
    },
    {
      title:"5",
      value:"5"
    },
    {
      title:"6",
      value:"6"
    },
    {
      title:"-",
      value:"-"
    },
    {
      title:"1",
      value:"1"
    },
    {
      title:"2",
      value:"2"
    },
    {
      title:"3",
      value:"3"
    },
    {
      title:"+",
      value:"+"
    },
    {
      title:"0",
      value:"0"
    },
    {
      title:".",
      value:"."
    },
    {
      title:"=",
      value:"="
    },
  ];
  const state = {
    inputV:ref(""),
    buttonList:reactive(buttonList)
  }
  const App = {
    setup(){
      return {
        state
      }
    },
    template:`
    <div>
      <input v-model="state.inputV.value" class="cal-header" placeholder="输入数字">
      <div class="cal-main">
        <div v-for="(item,index) in state.buttonList" class="cal-button-item">{{item.title}}</div>
      </div>

    </div>
    `
  };
  createApp(App).mount("#app")
</script>
</body>
</html>